<%@page contentType="text/html; charset=utf-8"%>
<script type="text/javascript" src="../../components/jscommons/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
		queryWorkflows(workflowRole);
	});
	
var queryWorkflows = function(workflowRole){
	jQuery.post("/finance/workflow/queryWorkflowByUser.do",{userId:userId},function(str){
			//拼表头
			var htmltxtHead = '<thead>'
			                    	+'<tr>'
			                        	+'<th width="100">序号</th>'
			                          +'<th width="250">申请名称</th>'
			                            +'<th width="120">申请人</th>'
			                          +'<th width="250">申请时间</th>'
			                            +'<th width="130">操作</th>'
			                        +'</tr>'
			                    +'</thead>';
			var htmltxtcontent = "";	
			var data = eval('(' + str + ')');
			htmltxtcontent += '<tbody>';
			for (var i=0; i<data.data.length; i++) {
				 htmltxtcontent += '<tr>'
			                        	+'<td width="100">'+(i+1)+'</td>'
			                          +'<td width="250">'+data.data[i].workflowName+'</td>'
			                            +'<td width="120">'+data.data[i].applyUserName+'</td>'
			                            +'<td width="250">'+data.data[i].createTime+'</td>';
			                            if(workflowRole=='workflowApprovers'){
			                           		htmltxtcontent+='<td width="130"><a href="/finance/views/user/eventaudit_audit_index.jsp?workflowCode='+data.data[i].workflowCode +'" target="_blank">去审批</a></td>';
			                            }
			                            if(workflowRole=='workflowAuditors'){
				                            htmltxtcontent+='<td width="130"><a href="/finance/views/user/eventaudit_approve_index.jsp?workflowCode='+data.data[i].workflowCode +'" target="_blank">去审批</a></td>';
			                            }
			                        htmltxtcontent+='</tr>';
			}
			htmltxtcontent += '</tbody>';
			 $("#jigou").html(htmltxtHead+htmltxtcontent);
			 
        });
        
}
</script>
<div id="rightsiber">
           	   <h1>待审批流程列表</h1>
             
                <table id="jigou" width="840">
                	
                </table>
 
            </div>